#if !defined(AFX_MANUALLOADERPORT_H__FFF3CE25_07AD_4CC6_888E_13D96755570D__INCLUDED_)
#define AFX_MANUALLOADERPORT_H__FFF3CE25_07AD_4CC6_888E_13D96755570D__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ManualLoaderPort.h : header file
//

#include "Util\MinButton.h"
#include "Util\MinLabel.h"

// Control Layer
class ILoaderPort;
class IStateRobotBuffer;
class IRobotBuffer;

// Process Layer
class IAutoManager;
class ITrsLoaderPort;
class ITrsRobotBuffer;
// Common Layer
class CDMControlCenter;
class CFosbLiftPosData;
class CErrorCodeData;
class CDSTapeMountDoc;
class CSystemData;

#define MAX_LP_PUSH_SW		10

/////////////////////////////////////////////////////////////////////////////
// CManualLoaderPort dialog

class CManualLoaderPort : public CDialog
{
private:
	IAutoManager* m_lnkAutoManager;
	ILoaderPort* m_lnkLoaderPort;
	ITrsLoaderPort* m_lnkTrsLoaderPort;
	CFosbLiftPosData* m_lnkFosbLiftPosData;
	IStateRobotBuffer* m_lnkStateRobotBuffer;

	CSystemData* m_lnkSystemData;

	void ErrorDisplay(int nErrorCode);
	BOOL m_bErrorDisplay;
	CErrorCodeData* m_lnkErrorCodeData;

	double m_dSenserOnPos[25];
	double m_dSenserOffPos[25];
	double m_dOnOffSumPos[25];

	BOOL StartInitFlag;
	BOOL m_bOldStatusPush[MAX_LP_PUSH_SW];
	CMinLabel	m_sBcrData;


// Construction
public:
	UINT m_TimerID;
	BOOL m_TimerInitFlag;

	CManualLoaderPort(IAutoManager* pAM, CDMControlCenter* pDMCC,CWnd* pParent = NULL);   // standard constructor

// Dialog Data
	//{{AFX_DATA(CManualLoaderPort)
	enum { IDD = IDD_MANUAL_LP };
	CMinButton	m_bBCRReading;
	CMinButton	m_bExit;
	CMinButton	m_bMappingReady;
	CMinButton	m_bMappingEnd;
	CMinButton	m_bMapping;
	CMinButton	m_bFosbUnlock;
	CMinButton	m_bFosbUnloading;
	CMinButton	m_bFosbUnclamp;
	CMinButton	m_bFosbLock;
	CMinButton	m_bFosbLoading;
	CMinButton	m_bFosbForward;
	CMinButton	m_bFosbDoorVacuumOn;
	CMinButton	m_bFosbDoorVacuumOff;
	CMinButton	m_bFosbDoorOpen;
	CMinButton	m_bFosbDoorClose;
	CMinButton	m_bFosbClam;
	CMinButton	m_bFosbBackward;
	CMinButton	m_bFosbArmFor;
	CMinButton	m_bFosbArmBack;
	CMinButton	m_bDoorOpen;
	CMinButton	m_bDoorClose;
	//}}AFX_DATA


// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CManualLoaderPort)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	CDSTapeMountDoc* m_pDoc;
	IAutoManager* m_pAM;

	void ButtonInitial();
	void ButtonUpdate();
	// Generated message map functions
	//{{AFX_MSG(CManualLoaderPort)
	afx_msg void OnFosbLock();
	afx_msg void OnFosbUnlock();
	afx_msg void OnFosbForward();
	afx_msg void OnFosbBackward();
	afx_msg void OnFosbClam();
	afx_msg void OnFosbUnclamp();
	afx_msg void OnFosbDoorVacuumOn();
	afx_msg void OnFosbDoorVacuumOff();
	afx_msg void OnFosbDoorOpen();
	afx_msg void OnFosbDoorClose();
	afx_msg void OnFosbArmFor();
	afx_msg void OnFosbArmBack();
	afx_msg void OnFosbLoading();
	afx_msg void OnDoorOpen();
	afx_msg void OnMappingReady();
	afx_msg void OnMapping();
	afx_msg void OnMappingEnd();
	afx_msg void OnDoorClose();
	afx_msg void OnFosbUnloading();
	afx_msg void OnExit();
	afx_msg void OnTimer(UINT nIDEvent);
	virtual BOOL OnInitDialog();
	afx_msg void OnDestroy();
	afx_msg void OnBcrReading();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};


//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_MANUALLOADERPORT_H__FFF3CE25_07AD_4CC6_888E_13D96755570D__INCLUDED_)
